package com.usercon.userconter.service;

import com.usercon.userconter.Utils.MD5Util;
import com.usercon.userconter.mapper.UserMapper;
import com.usercon.userconter.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserService {

    private UserMapper userMapper;

    @Autowired
    public void setUserMapper(UserMapper userMapper) {
        this.userMapper = userMapper;
    }

    public List<User> findAll(){
        System.out.println("UserService已调用 返回值:" + userMapper.getUserList());
        return userMapper.getUserList();
    }

    public User findById(int id) {
        return userMapper.getUserById(id);
    }

    public int addUser(int id,String username,String password){
        return userMapper.addUser(id,username,password);
    }

    public int updateUser(User user){
        return userMapper.updateUser(user);
    }

    public Integer deleteUser(int id){
        return userMapper.deleteUser(id);
    }

    public Integer userStatus(int id){
        return userMapper.userStatus(id);
    }

}
